AlaskaLinuxUser's Scratchpad

Commit thy works unto the LORD, and thy thoughts shall be established. - Proverbs 16:3

Trading in WordPress for Pelican

pelican.jpg

Since 2018, I've been using WordPress as my CMS, Content Management System, for my blog. WP is a really handy program for writing blogs, it comes with tons of features, and great add ons, as well as a lot of documented support. It also comes with PHP requirements, JavaScript, and potentially other requirements that can be potentially insecure and are often quite resource heavy. As your implementation grows, so does your MariaDB database. Pages often have to run scripts to accomplish your goals, and the website gets a little harder to maintain.

Recently, with some changes to my NextCloud implementation, I had conflicts with PHP versions between Wordpress and my NextCloud instance. While this was not insurmountable, it lead me down the path of finding a replacement for WordPress. Sort of the straw that broke the camel's back, as it were.

I decided if I was going to make a change, I didn't want to just change CMS, but rather change what type of CMS I was going to use. For that type, I settled on a static site generator. A static site generator will build your website statically before hand, making it quick and easy to deploy and use, rather than generating pages at the time of call for a page, which can get bogged down and is more resource intensive.

I went through several options, a big goal of mine was to have something that in the end, and hopefully throughout, was not using PHP, nor JavaScript. Jekyll had some promise, but seemed a bit heavy and excessive to me, perhaps I was also overwhelmed by all the plugins and options. I finally settled on Pelican.

Pelican is a static site generator that requires no database or server-side logic. Pelican

Now, I don't know if Pelican is perfect, but it sure seems like a perfect fit for me at the moment. Not only does it require no database or server-side logic, as their slogan states, I can generate my entire website (imported from WordPress, going back to 2018) with over 600 pages, tags, categories, links, etc., in under 50 seconds. Not only that, but Pelican has multiple theme options:

Pelican Themes

I will note that some themes can use JavaScript, I chose a theme which originally did use one JS script to run something, but removed it from the theme. There are plenty of themes without JS, I just really liked the look of this one, but didn't want the included JS, so I ditched it in the theme code.

Every post is written in simple mark down language, which Pelican converts into HTML for me. It's simple, like me! There was also an import feature, which allowed you to convert your old WordPress site into mark down files so you could include them into your new website. The syntax I used went like this:

$ pelican-import --wpfile -o output/ -m markdown ./posts.xml $ pelican-import --wpfile -o output/ -m markdown --dir-page ./pages.xml

Where posts.xml and pages.xml were exported from WordPress. One great thing about Pelican, is that it also generates all the tags into links on my website, so people can click on them to read more about any particular subject. I was a little concerned at first that nobody would be able to find anything, since there is no search bar (it was JS, but I removed it), but between categories and tags, that doesn't seem to be a problem.

So far, I'm very pleased with the results. I do miss the comments section, and I could enable it with JavaScript, but I really don't want to use JS, and if I did, in the past I spent more time weeding out spammers than actually responding to real comments, which is sad, but the truth. Perhaps someday I'll think of something, but for now, I am forgoing the comments section.

So, if you too used WordPress, and have been wondering about alternatives, perhaps you should try Pelican too. It certainly has made my website snappy! Pages load almost instantly, since they are just plain old HTML with a tiny bit of CSS for styling. Which, if you didn't want that, there are themes without CSS as well.

Linux - keep it simple.